import 'package:ai/config/Config.dart';
import 'package:ai/util/SharedPreferencesUtil.dart';
import 'package:flutter/material.dart';

import 'AppRouter.dart';

void main() async {
  // 确保初始化完成
  WidgetsFlutterBinding.ensureInitialized();
  // 初始化 SharedPreferencesUtil
  await SharedPreferencesUtil().init();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({super.key});

  final _appRouter = AppRouter();

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      debugShowCheckedModeBanner: false,
      title: '小茶智能写作AI',
      theme: ThemeData(
      ),
      routerConfig: _appRouter.config(),
    );
  }
}
